﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using IMedicare.Tool;

namespace IMedicare
{
    public partial class FrmSelectType : Form
    {
        public FrmSelectType()
        {
            InitializeComponent();


            cboMedType.DataSource = ReadConfig.GetConfig();
            cboMedType.DisplayMember = "MedicareText";
            cboMedType.ValueMember = "MedicareValue";
            if (cboMedType.Items.Count > 0)
                this.cboMedType.SelectedIndex = 0;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            //MedType = cboMedType.SelectedItem.ToString().Split('_')[1].Trim();
            if (string.Empty.Equals(MedType))
            {
                MessageBox.Show("请选择医疗类别！");
                return;
            }
            this.Close();
        }

        private string _medType;

        /// <summary>
        /// 医疗类别
        /// </summary>
        public string MedType
        {
            get { return (string)cboMedType.SelectedValue; }
        }
    }
}
